package org.cgs.web.beans;

import java.util.ArrayList;
import java.util.List;

public final class Instructor
{
    private List<String> courses = new ArrayList<String>();
    private String name;
    
    public List<String> getCourses()
    {
    	return courses;
    }
    
    public void setCourses(List<String> c)
    {
    	courses = c;
    }
    
    public String getName()
    {
    	return name;
    }
    
    public void setName(String n)
    {
    	name = n;
    }

    public int compareTo(Instructor o)
    {
    	return o.name.compareTo(this.name);
    }
    
    @Override
    public boolean equals(Object o)
    {
    	if(o instanceof Instructor)
    	{
    		Instructor i = (Instructor) o;
    		return i.name.equals(name);
    	}
    	
    	return false;
    }

    @Override
    public int hashCode()
    {
    	return name.hashCode();
    }
}
